package logincontroller;

import android.app.Activity;
import android.content.Intent;

import activity.addressmanage.AddressListActivity;
import activity.messge.MessageActivity;
import activity.messge.RepairMessActivity;
import activity.messge.SysTemMessgeActivity;
import activity.personal.ActivityPersonnalInfomaton;
import activity.personal.ActivityQianBao;
import activity.personal.ActivityRepair;
import activity.personal.WeiXiuRecord;
import activity.personal.qianbao.ZhiFuPassActivity;
import activity.signin.SignInShowActivity;
import activity.store.OrderActivity;
import activity.store.ShopCartActivity;
import base.MyApplcation;
import presenter.BasePresenter;
import util.utls.IsUtilUid;


/***
 * 
 * @author 在登录状态下执行该方法
 * 
 */
public class LoginedState implements ILoginState {

	BasePresenter projectpresenter;

	String uid;
	String id;
	// 状态为登录的时候执行本类里的方法

	/**
	 * 个人信息
	 * @param activity
	 * @param obj
     */
	@Override
	public void PersonnalInfomaton(Activity activity, Object obj) {
		// TODO Auto-generated method stub
		Intent intent = new Intent(activity, ActivityPersonnalInfomaton.class);
		activity.startActivityForResult(intent, 101);
	}

	@Override
	public void onSysTime(Activity activity, Object obj) {
		Intent intent = new Intent(activity, SysTemMessgeActivity.class);
		activity.startActivityForResult(intent, 101);
	}
	/**
	 * 购物车
	 */
	@Override
	public void onGouWuChe(Activity activity, Object obj) {
		Intent intent = new Intent(activity, ShopCartActivity.class);
		activity.startActivity(intent);
	}

	@Override
	public void onMessge(Activity activity, Object obj) {
		Intent intent = new Intent(activity, RepairMessActivity.class);
		activity.startActivityForResult(intent, 101);
	}

	@Override
	public void onWeiXiu(Activity activity, Object obj) {
		Intent intent = new Intent(activity, WeiXiuRecord.class);
		activity.startActivityForResult(intent, 101);
	}

	@Override
	public void onJineng(Activity activity, Object obj) {
		Intent intent = new Intent(activity, ActivityRepair.class);
		activity.startActivityForResult(intent, 101);
	}

	/**
	 * 收货地址
	 */
	@Override
	public void onShouHuoDiZhi(Activity activity, Object obj) {
		Intent intent = new Intent(activity, AddressListActivity.class);
		intent.putExtra("type","2");
		activity.startActivity(intent);
	}

	@Override
	public void onDingDan(Activity activity, Object obj) {
		Intent intent = new Intent(activity, OrderActivity.class);
		activity.startActivity(intent);
	}

	@Override
	public void onQian(Activity activity, Object obj) {
		String  pwd= IsUtilUid.isPay();
		if(pwd==null || pwd.equals("")){
			Intent intent=new Intent(MyApplcation.ctx,ZhiFuPassActivity.class);
			activity.startActivity(intent);
		}else{
			Intent intent = new Intent(activity, ActivityQianBao.class);
			activity.startActivityForResult(intent, 101);
		}
	}
	/**
	 * 消息
	 */
	@Override
	public void onXiaoXi(Activity activity, Object obj) {
		Intent intent = new Intent(activity, MessageActivity.class);
		activity.startActivity(intent);
	}
	/**
	 * 签到记录
	 */
	@Override
	public void onQianDao(Activity activity, Object obj) {
		Intent intent = new Intent(activity, SignInShowActivity.class);
		activity.startActivity(intent);
	}
}
